﻿using System;
using Abp.Runtime.Validation;
using pandx.Mulan.Dto;
using pandx.Mulan.Flows;

namespace pandx.Mulan.Flow.FlowInstances.Dto
{
    public class ObtainFlowInstancesInput:PagedSortedAndFilteredInput,IShouldNormalize
    {
        public string Type { get; set; }
        public FlowInstanceState? State { get; set; }
        public DateTime StartTime { get; set; }
        public DateTime EndTime { get; set; }
        public void Normalize()
        {
            if (string.IsNullOrEmpty(Sorting))
            {
                Sorting = "Instance.CreationTime DESC";
            }

            Filter = Filter?.Trim();
        }
    }
}
